unit Project_DM;

interface

uses
  System.SysUtils, System.Classes, Oracle, Data.DB, OracleData;

type
  TdmProject = class(TDataModule)
    dsTable: TOracleDataSet;
    fTableTABLE_NAME: TStringField;
    fTableTABLESPACE_NAME: TStringField;
    fTableCLUSTER_NAME: TStringField;
    fTableIOT_NAME: TStringField;
    fTableSTATUS: TStringField;
    fTablePCT_FREE: TFloatField;
    fTablePCT_USED: TFloatField;
    fTableINI_TRANS: TFloatField;
    fTableMAX_TRANS: TFloatField;
    fTableINITIAL_EXTENT: TFloatField;
    fTableNEXT_EXTENT: TFloatField;
    fTableMIN_EXTENTS: TFloatField;
    fTableMAX_EXTENTS: TFloatField;
    fTablePCT_INCREASE: TFloatField;
    fTableFREELISTS: TFloatField;
    fTableFREELIST_GROUPS: TFloatField;
    fTableLOGGING: TStringField;
    fTableBACKED_UP: TStringField;
    fTableNUM_ROWS: TFloatField;
    fTableBLOCKS: TFloatField;
    fTableEMPTY_BLOCKS: TFloatField;
    fTableAVG_SPACE: TFloatField;
    fTableCHAIN_CNT: TFloatField;
    fTableAVG_ROW_LEN: TFloatField;
    fTableAVG_SPACE_FREELIST_BLOCKS: TFloatField;
    fTableNUM_FREELIST_BLOCKS: TFloatField;
    fTableDEGREE: TStringField;
    fTableINSTANCES: TStringField;
    fTableCACHE: TStringField;
    fTableTABLE_LOCK: TStringField;
    fTableSAMPLE_SIZE: TFloatField;
    fTableLAST_ANALYZED: TDateTimeField;
    fTablePARTITIONED: TStringField;
    fTableIOT_TYPE: TStringField;
    fTableTEMPORARY: TStringField;
    fTableSECONDARY: TStringField;
    fTableNESTED: TStringField;
    fTableBUFFER_POOL: TStringField;
    fTableROW_MOVEMENT: TStringField;
    fTableGLOBAL_STATS: TStringField;
    fTableUSER_STATS: TStringField;
    fTableDURATION: TStringField;
    fTableSKIP_CORRUPT: TStringField;
    fTableMONITORING: TStringField;
    fTableCLUSTER_OWNER: TStringField;
    fTableDEPENDENCIES: TStringField;
    fTableCOMPRESSION: TStringField;
    fTableDROPPED: TStringField;
    fTableCOMMENTS: TStringField;
    dsColumn: TOracleDataSet;
    fColumnTABLE_NAME: TStringField;
    fColumnCOLUMN_NAME: TStringField;
    fColumnDATA_TYPE: TStringField;
    fColumnDATA_TYPE_MOD: TStringField;
    fColumnDATA_TYPE_OWNER: TStringField;
    fColumnDATA_LENGTH: TFloatField;
    fColumnDATA_PRECISION: TFloatField;
    fColumnDATA_SCALE: TFloatField;
    fColumnNULLABLE: TStringField;
    fColumnCOLUMN_ID: TFloatField;
    fColumnDEFAULT_LENGTH: TFloatField;
    fColumnDATA_DEFAULT: TMemoField;
    fColumnNUM_DISTINCT: TFloatField;
    fColumnLOW_VALUE: TStringField;
    fColumnHIGH_VALUE: TStringField;
    fColumnDENSITY: TFloatField;
    fColumnNUM_NULLS: TFloatField;
    fColumnNUM_BUCKETS: TFloatField;
    fColumnLAST_ANALYZED: TDateTimeField;
    fColumnSAMPLE_SIZE: TFloatField;
    fColumnCHARACTER_SET_NAME: TStringField;
    fColumnCHAR_COL_DECL_LENGTH: TFloatField;
    fColumnGLOBAL_STATS: TStringField;
    fColumnUSER_STATS: TStringField;
    fColumnAVG_COL_LEN: TFloatField;
    fColumnCHAR_LENGTH: TFloatField;
    fColumnCHAR_USED: TStringField;
    fColumnV80_FMT_IMAGE: TStringField;
    fColumnDATA_UPGRADED: TStringField;
    fColumnHISTOGRAM: TStringField;
    oraSession: TOracleSession;
    fColumnDATA_TYPE_FULL: TStringField;
    fColumnHIDDEN_COLUMN: TStringField;
    fColumnVIRTUAL_COLUMN: TStringField;
    fColumnSEGMENT_COLUMN_ID: TFloatField;
    fColumnINTERNAL_COLUMN_ID: TFloatField;
    fColumnQUALIFIED_COL_NAME: TStringField;
    fColumnCOLUMN_COMMENT: TStringField;
    dsUser: TOracleDataSet;
    dsProcedure: TOracleDataSet;
    fProcedureNAME: TStringField;
    fProcedureLINE: TFloatField;
    fProcedureTEXT: TStringField;
    dsTrigger: TOracleDataSet;
    dsSequence: TOracleDataSet;
    fSequenceSEQUENCE_NAME: TStringField;
    fSequenceMIN_VALUE: TFloatField;
    fSequenceMAX_VALUE: TFloatField;
    fSequenceINCREMENT_BY: TFloatField;
    fSequenceCYCLE_FLAG: TStringField;
    fSequenceORDER_FLAG: TStringField;
    fSequenceCACHE_SIZE: TFloatField;
    fSequenceLAST_NUMBER: TFloatField;
    fTriggerNAME: TStringField;
    fTriggerTYPE: TStringField;
    fTriggerLINE: TFloatField;
    fTriggerTEXT: TStringField;
    dsView: TOracleDataSet;
    fViewVIEW_NAME: TStringField;
    fViewTEXT_LENGTH: TFloatField;
    fViewTEXT: TMemoField;
    fViewTYPE_TEXT_LENGTH: TFloatField;
    fViewTYPE_TEXT: TStringField;
    fViewOID_TEXT_LENGTH: TFloatField;
    fViewOID_TEXT: TStringField;
    fViewVIEW_TYPE_OWNER: TStringField;
    fViewVIEW_TYPE: TStringField;
    fViewSUPERVIEW_NAME: TStringField;
  private
    { Private declarations }
  public
    { Public declarations }
    procedure SetCurrentSchema(Schema: string);
  end;

var
  dmProject: TdmProject;

implementation

{ %CLASSGROUP 'Vcl.Controls.TControl' }

{$R *.dfm}
{ TdmProject }

procedure TdmProject.SetCurrentSchema(Schema: string);
var
  qr: TOracleQuery;
begin
  qr := TOracleQuery.Create(Self);
  try
    qr.Session := oraSession;
    qr.SQL.Text := 'ALTER SESSION SET CURRENT_SCHEMA = ' + Schema;
    qr.Execute;
  finally
    qr.Free;
  end;
end;

end.
